package kr.saeildamil.androidStudy_second.fragment.cp;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class WordDBHelper extends SQLiteOpenHelper {
	final static String TAG = "WordDBHelper";

	public WordDBHelper(Context context) {
		super(context, "English.db", null, 1);
	}

	public void onCreate(SQLiteDatabase db) {
		Log.d(TAG, "onCreate");
		String sql = 	"CREATE TABLE dic ( " + 
						"_id INTEGER PRIMARY KEY AUTOINCREMENT, "+ 
						"eng Text, " + 
						"han Text" + 
						");";
		db.execSQL(sql);
	}

	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		Log.d(TAG, "onUpgrade");
		String sql = "DROP TABLE IF EXISTS dic";
		db.execSQL(sql);
	}

}
